//
//  main.swift
//  第一个swift
//
//  Created by zhangjianyun on 17/6/22.
//  Copyright © 2017年 com.taihejiacheng. All rights reserved.
//

import Foundation

var score = 80

var scoreArr = [90,100,3,43,43,67]

var min = scoreArr[0]

var max = scoreArr[0]

var avg = 0.0

var sum : Double = 0.0

var count = scoreArr.count

for s in scoreArr {
    sum = sum + Double(s)
    print(s);
    
    if (min > s) {
        min = s
    }
    if (max < s) {
        max = s
    }
}
print(sum)
print(sum / Double(count))
print("max is\(max)")
print("min is" + String(min))

for i in 0 ..< scoreArr.count {
    var s = scoreArr[i]
    print(s)
}

var index = 0

repeat {
    print(scoreArr[index])
    index = index+1
} while index<count

index = 0
while (index < count) {
    print("while" + String(scoreArr[index]))
    index = index + 1
}

let type = "ios"

switch type {
    case "ios":
        print("This is 苹果")
    case "andrnd":
        print("this is 安卓")
    default:
        print("hah")
}


textFunction()
